package pattern.composite;

import java.util.Iterator;

public class File extends FileComponent {
	
	private String name;
	
	private String fileType;
	
	public File(String name, String fileType){
		this.name = name;
		this.fileType = fileType;
	}
	
	@Override
	public String getName() {
		return name;
	}
	
	@Override
	public String getFileType() {
		return fileType;
	}
	
	@Override
	public void print() {
		System.out.println(name + "." + fileType);
		System.out.println("----------");
	}
	
	@Override
	public Iterator<FileComponent> createIterator() {
		return new NullIterator();
	}
}
